#ifndef VISUALIZER_H
#define VISUALIZER_H



#include <opencv2/core/core.hpp>
//#include <opencv2/highgui/highgui.hpp>

#include "sharedStructure.hpp"
#include "tanOR.h"

class visualizer{
public:
	visualizer(){window_name = "default ";initialColor();frame_index=0;};
	visualizer(const char* name);
	void initialColor();

	void setBackground(int width, int height, unsigned char* r_map, unsigned char* g_map, unsigned char *b_map);
	void cleanImage( );
	void drawText(int x,int y, const char* txt, int color_index , int thickness);
	void drawLine(int x1, int y1, int x2, int y2, int color_index, int thickness);
	void drawLinePairs(std::deque<pt_pair_s> pts,int color_index , int thickness );
	void drawP(float P[][4]);
	void show(int t);// to update the frame
	void save(int i );
	void drawVolPtc(volParticle_s &ptc, int i_color);
	void drawRootPtc(rootParticle_s &ptc);
	void drawTanTemplate(tanOR &tan, float P[3][4],float cam_dir[3],int color);
	void draw3DLine(float P[3][4],float X1, float Y1, float Z1, float X2, float Y2, float Z2, int color);
	void release();
	static void outImage(const char* file_name, int sx, int sy, float *map,int sub =1);
	static void outTanOrMap(int id, float pan, float tilt, float roll, float dist, int sx, int sy,float* map);
private:
	cv::Mat src_img;
	cv::Mat curr_img;
	const char* window_name;
	int frame_index;


	float X[28][4];
	/*

*/
};
#endif